
const Router = require('koa-router')
const { 
  getblog,
  addblog,
  getOne,
  getSelectBlog,
  updateView,
  updateLike,
  getCunt,
  editList,
  addList,
  deleteList,
  getOneList,
  getBlogSearch
 } = require('../controller/blog.controller')
const router = new Router({prefix:'/blog'})
const { auth } = require("../middleware/admin.middleware")
router.post('/list',getblog)
router.post('/detail',getOne)
router.post('/add',addblog)
router.post('/select',getSelectBlog)
router.post('/view',updateView)
router.post('/like',updateLike)
router.post('/all',auth,getCunt)
router.post('/insert',auth,addList)
router.post('/edit',auth,editList)
router.post('/delete',auth,deleteList)
router.post('/one',auth,getOneList)
router.post('/search',getBlogSearch)
module.exports = router